﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Volo.Abp;

namespace Acme.ConcreteMixDesign.Controllers
{ 

    [Route("api/JobRecord")]
    public class JobRecordController : ConcreteMixDesignController, IJobRecordAppService
    {
        private readonly IJobRecordAppService _jobRecordAppService;
        public JobRecordController(IJobRecordAppService jobRecordAppService)
        {
            _jobRecordAppService = jobRecordAppService;
        }
        [HttpGet]
        [Route("WordDownload")]
        [ApiExplorerSettings(IgnoreApi = true)]
        public Task<Stream> GetWordAsync(Guid Jobid)
        {
            return _jobRecordAppService.GetWordAsync(Jobid);
        }

        [HttpGet]
        [Route("WordDownloadFile")]
        public async Task<IActionResult> GetWordFileAsync(Guid Jobid)
        {
            var result=await _jobRecordAppService.GetWordAsync(Jobid);
            return File(result, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "test.docx");
        }

        
    }
}
